package com.zeng.sboot.oss.utils;

import com.aliyun.oss.OSS;
import com.aliyun.oss.OSSClientBuilder;
import com.aliyun.oss.model.Bucket;

import java.util.List;

public class OssUtil {

    private static OSS ossClient;

    public OssUtil() {}
    public OssUtil(String endpoint, String accessKeyId, String accessKeySecret) {


    }

    public static OSS init(String endpoint, String accessKeyId, String accessKeySecret) {
        ossClient = new OSSClientBuilder().build(endpoint, accessKeyId, accessKeySecret);
        return ossClient;
    }

    public static List<Bucket> showBucketList() {
        List<Bucket> buckets = ossClient.listBuckets();
        return buckets;
    }



}
